package rubik;

import aima.core.search.framework.GoalTest;

public class RubikCubeGoalTest implements GoalTest{
    @Override
	public boolean isGoalState(Object state) {
		Cube cubo = (Cube) state;
                boolean retVal = true;
		if(cubo.getDimension() == 2) retVal = cubo.equals(Cube.SOLVED2x2);
                else if(cubo.getDimension() == 3) retVal = cubo.equals(Cube.SOLVED3x3);
                    else retVal = cubo.equals(new Cube(cubo.getDimension(),false));
                return retVal;
	}   
}